-- vim: ft=lua

conky.config = {
    out_to_x = false,
    own_window = false,
    out_to_console = true,
    background = false,
    max_text_width = 0,

    -- Update interval in seconds
    update_interval = 2.0,

    -- This is the number of times Conky will update before quitting.
    -- Set to zero to run forever.
    total_run_times = 0,

    -- Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
    short_units = true,

    -- How strict should if_up be when testing an interface for being up?
    -- The value is one of up, link or address, to check for the interface
    -- being solely up, being up and having link or being up, having link
    -- and an assigned IP address.
    if_up_strictness = 'address',

    -- Add spaces to keep things from moving about?  This only affects certain objects.
    -- use_spacer should have an argument of left, right, or none
    use_spacer = 'left',

    -- Force UTF8? note that UTF8 support required XFT
    override_utf8_locale = false,

    -- number of cpu samples to average
    -- set to 1 to disable averaging
    cpu_avg_samples = 2,
};


-- 字体：sudo pacman -S ttf-nerd-fonts-symbols
-- 公网地址
-- 资源
-- { "full_text" : "${fs_used_perc /}%" , "color" : "\#800000" },
-- 音量
-- { "full_text" : "${exec amixer | awk 'NR==6{if($6=="[on]") {print substr($5,2,length($5)-2)} else {print "off"}}'}", "color": "\#0080F0" },
-- 电池
-- { "full_text" : "${battery_percent}%" , "color" : "\#C04080" },
-- 时间
conky.text = [[
[
    { "full_text" : "${exec curl icanhazip.com --ipv4}", "color": "\#0000A0" },
    { "full_text" : ${if_up eno1} "${upspeed eno1}/s ${downspeed eno1}/s" ${else} ""${endif}, "color" : "\#008080" },
    { "full_text" : ${if_up wlo1} "${upspeed wlo1}/s ${downspeed wlo1}/s" ${else} ""${endif}, "color" : "\#800000" },

    { "full_text" : "${cpu cpu0}%" , "color" : "\#B05000" },
    { "full_text" : "${mem}" , "color" : "\#800050" },

    { "full_text" : "${time %Y-%m-%d %a}" , "color" : "\#00A0F0" },
    { "full_text" : "${time %H:%M}" , "color" : "\#D02070" }
],
]];
